#include<iostream>
#include<queue>
#include<vector>
using namespace std;

vector<int> v;

int main()
{
    int n, m, k;
    scanf("%d, %d, %d", &n,&m,&k);
	while(n--)
	{
		int x; scanf("%d ", &x);
		v.push_back(x);
	}
    while(m--)
    {
        int op;scanf("%d ", &op);
        if(op==1)
        {
            int x; scanf("%d ", &x);
            v.push_back(x);
        }
        if(op==2){
            if(k>v.size()) 
                cout<<-1<<endl;
            else{
                priority_queue<int> q;
                for(int i=0; i<v.size(); i++){
                    if(q.size() <k) q.push(v[i]);
                    else{
                        if(v[i]<q.top()){
                            q.pop();
                            q.push(v[i]);
                        }
                    }
                }
                printf("%d\n", q.top());
            }
        }
    }
    return 0;
} 
